<include file="Public/min-header"/>
<div class="wrapper">
	<style type="text/css">
		.table-bordered{border:20px solid #f4f4f4;border-radius: 20px;overflow: hidden;}
	</style>
     <form method="post" id="handlepost" action="{:U('Store/goodd_class_save')}">
      <div class="tab-content">                 	  
          <div class="tab-pane active" id="tab_tongyong">                           
	        <table class="table table-bordered">
	            <tbody>
	            <tr>
	                <td class="col-sm-2">分类名称：</td>
	                <td>
	                    <input type="text" class="input-sm" style="width:250px;" name="cat_name" value="{$info.cat_name}">                                                         
	                </td>
	            </tr> 
<!-- 	            <tr>
	            <td>上级分类：</td>
	            <td>			
					<select name="parent_id" id="parent_id" value="{$menu.parent_id}" class="input-sm">	
						<option value="0">顶级菜单</option>		
						<foreach name="parent" item="v">
							<option value="{$v.cat_id}" <if condition="$v[cat_id] eq $info[parent_id]"> selected="selected"</if>>&nbsp;&nbsp;|--{$v.cat_name}</option>
						</foreach>
					</select>                       
	            </td>
	            </tr> -->
	            <tr>
	            	<td>此类商品显示数量：</td>
	            	<td><input type="text" class="input-sm" name="show_num" value="{$info.show_num}"></td>
	            </tr>
	            <tr>
	                <td>是否显示：</td>
	                <td>
	                	<input name="is_show" type="radio" value="1" <if condition="$info[is_show] eq 1">checked</if>>是
	                	<input name="is_show" type="radio" value="0" <if condition="$info[is_show] eq 0">checked</if>>否
					</td>
	            </tr>
	            <tr>
	                <td>是否导航显示：</td>
	                <td>
	                	<input name="is_nav_show" type="radio" value="1" <if condition="$info[is_nav_show] eq 1">checked</if>>是
	                	<input name="is_nav_show" type="radio" value="0" <if condition="$info[is_nav_show] eq 0">checked</if>>否
					</td>
	            </tr>
	            <tr>
	                <td>是否首页推荐：</td>
	                <td>
	                	<input name="is_recommend" type="radio" value="1" <if condition="$info[is_recommend] eq 1">checked</if>>是
	                	<input name="is_recommend" type="radio" value="0" <if condition="$info[is_recommend] eq 0">checked</if>>否
					</td>
	            </tr>
	            <tr>
	                <td>排序：</td>
	                <td><input type="text" name="cat_sort" value="{$info.cat_sort}" class="input-sm" /></td>
	            </tr>
				<tr>                                    
					<td>分类图标</td>                                    
					<td>                      					
						<div class="col-sm-3">                      						
						<input type="text" class="input-sm" style="width:250px;margin-left:-15px;" name="image" id="image" value="{$info.image}" >                      					
						</div>                      					
						<div class="col-sm-6" style="margin-left:45px"> 
						<input type="button" class="btn btn-default" onClick="GetUploadify(1,'image','ad','')"  value="上传图片"/> <span style="color: red;">（ 建议图片大小：100x100像素正方形图片）</span>
						</div>                                    
					</td>																
				</tr>
				
<!-- 				<tr>                                    
					<td>绑定类型</td>                                    
					<td>                      					
						<foreach name="goods_type_list" item="v2" key="k2" >  				
						    <input type="radio" name="type_id" value="{$v2['id']}" <if condition="$info[type_id] eq $v2['id']"> checked="checked"</if>/>
							&nbsp;&nbsp;{$v2['name']}     
                         </foreach>                    
					</td>																
				</tr> -->

	            </tbody> 
	            <tfoot>
	            	<tr>
	            	<td  colspan="2" style="text-align:center;">
	            		<input type="hidden" name="cat_id" value="{$info.cat_id}">
	            		<input type="hidden" name="parent_id" value="{:I('parent_id')}">
	            		<input class="btn btn-primary" type="button" onclick="dataSave()" value="保存"></td>
	            	</tr>
	            </tfoot>                               
	          </table>
	          </div>                           
	      </div>              
</form>
</div>
<script type="text/javascript">
	function dataSave(){
		if($('input[name="cat_name"]').val() == ''){
			layer.msg('分类名称不能为空', {icon: 3});
			return;
		}
		$.ajax({
			url : "{:U('Store/goods_class_save')}",
			data : $('#handlepost').serialize(),
			type : 'post',
			dataType : 'json',
			success :function(data){
				if(data.stat=='ok'){
					window.parent.call_back(1);	
				}else{
					window.parent.call_back(0);
				}						
			}			
		});		
	}
</script>
</body>
</html>
